namespace Collaboris.Saf.Tests.Generated
{
    using System.Diagnostics;

    using Actions.Entities;
    using Actions.Powershell;

    using Engine.Report;

    using Microsoft.VisualStudio.TestTools.UnitTesting;

    /// <summary>
    /// This test was originally generated but has now been tested and verfiied by MJ
    /// </summary>
    [TestClass]
    public class ExecutePowershellTest
    {
        #region Public Methods

        [TestMethod]
        public void ExecutePowershell_Test()
        {
            var executepowershell =
                new TestAssistant<ExecutePowershell, ExternalEngineWrapper<PowershellScript>>(
                    TestEnvironment.PublishingSite, "ExecutePowershellTestWeb", "BLANKINTERNET#0");

            using (executepowershell)
            {
                Process notePad = new Process();

                notePad.StartInfo.FileName = "notepad.exe";
                notePad.Start();
                
                Assert.IsNotNull(Process.GetProcessesByName("Notepad").Length > 1);
                MacroReport doReport = executepowershell.DoMacro();

                MacroReport unDoReport = executepowershell.UndoMacro();

                Assert.IsNotNull(Process.GetProcessesByName("Notepad").Length < 1);

            }
        }

        #endregion
    }
}